using DataDynamics.ActiveReports;
using DataDynamics.ActiveReports.Export.Xls;
using SM;
using SM.core;
using SS;
using SS.dir;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using TVSGPP.func;
namespace TVSBH.func
{
	public class frmBookCleaningPharmacies : Form
	{
		private IContainer components = null;
		private Grid dgvProduct;
		private Button btnClose;
		private Button btnPrint;
		private System.Windows.Forms.Label lblWarning;
		private Button btnExportToExcel;
		private System.Windows.Forms.Label label4;
		private Button btnEdit;
		private Button btnUpdate;
		private Button btnAdd;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label11;
		private DateTimePicker dtpTime;
		private System.Windows.Forms.Label label12;
		private DataGridViewTextBoxColumn _Year;
		private DataGridViewTextBoxColumn _Month;
		private DataGridViewTextBoxColumn _Object;
		private DataGridViewTextBoxColumn _D1;
		private DataGridViewTextBoxColumn _D2;
		private DataGridViewTextBoxColumn _D3;
		private DataGridViewTextBoxColumn _D4;
		private DataGridViewTextBoxColumn _D5;
		private DataGridViewTextBoxColumn _D6;
		private DataGridViewTextBoxColumn _D7;
		private DataGridViewTextBoxColumn _D8;
		private DataGridViewTextBoxColumn _D9;
		private DataGridViewTextBoxColumn _D10;
		private DataGridViewTextBoxColumn _D11;
		private DataGridViewTextBoxColumn _D12;
		private DataGridViewTextBoxColumn _D13;
		private DataGridViewTextBoxColumn _D14;
		private DataGridViewTextBoxColumn _D15;
		private DataGridViewTextBoxColumn _D16;
		private DataGridViewTextBoxColumn _D17;
		private DataGridViewTextBoxColumn _D18;
		private DataGridViewTextBoxColumn _D19;
		private DataGridViewTextBoxColumn _D20;
		private DataGridViewTextBoxColumn _D21;
		private DataGridViewTextBoxColumn _D22;
		private DataGridViewTextBoxColumn _D23;
		private DataGridViewTextBoxColumn _D24;
		private DataGridViewTextBoxColumn _D25;
		private DataGridViewTextBoxColumn _D26;
		private DataGridViewTextBoxColumn _D27;
		private DataGridViewTextBoxColumn _D28;
		private DataGridViewTextBoxColumn _D29;
		private DataGridViewTextBoxColumn _D30;
		private DataGridViewTextBoxColumn _D31;
		private Button btnReset;
		private Func objFunc = new Func();
		private Bill objBill = new Bill();
		private frmWaitting objW;
		private DataTable objTable = new DataTable();
		public string userName = "";
		public string fullName = "";
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle9 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle10 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle11 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle12 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle13 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle14 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle15 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle16 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle17 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle18 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle19 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle20 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle21 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle22 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle23 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle24 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle25 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle26 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle27 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle28 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle29 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle30 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle31 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle32 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle33 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle34 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle35 = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmBookCleaningPharmacies));
			this.btnClose = new Button();
			this.btnPrint = new Button();
			this.lblWarning = new System.Windows.Forms.Label();
			this.btnExportToExcel = new Button();
			this.label4 = new System.Windows.Forms.Label();
			this.btnEdit = new Button();
			this.btnUpdate = new Button();
			this.btnAdd = new Button();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.label9 = new System.Windows.Forms.Label();
			this.label10 = new System.Windows.Forms.Label();
			this.label11 = new System.Windows.Forms.Label();
			this.dtpTime = new DateTimePicker();
			this.label12 = new System.Windows.Forms.Label();
			this.btnReset = new Button();
			this.dgvProduct = new Grid();
			this._Year = new DataGridViewTextBoxColumn();
			this._Month = new DataGridViewTextBoxColumn();
			this._Object = new DataGridViewTextBoxColumn();
			this._D1 = new DataGridViewTextBoxColumn();
			this._D2 = new DataGridViewTextBoxColumn();
			this._D3 = new DataGridViewTextBoxColumn();
			this._D4 = new DataGridViewTextBoxColumn();
			this._D5 = new DataGridViewTextBoxColumn();
			this._D6 = new DataGridViewTextBoxColumn();
			this._D7 = new DataGridViewTextBoxColumn();
			this._D8 = new DataGridViewTextBoxColumn();
			this._D9 = new DataGridViewTextBoxColumn();
			this._D10 = new DataGridViewTextBoxColumn();
			this._D11 = new DataGridViewTextBoxColumn();
			this._D12 = new DataGridViewTextBoxColumn();
			this._D13 = new DataGridViewTextBoxColumn();
			this._D14 = new DataGridViewTextBoxColumn();
			this._D15 = new DataGridViewTextBoxColumn();
			this._D16 = new DataGridViewTextBoxColumn();
			this._D17 = new DataGridViewTextBoxColumn();
			this._D18 = new DataGridViewTextBoxColumn();
			this._D19 = new DataGridViewTextBoxColumn();
			this._D20 = new DataGridViewTextBoxColumn();
			this._D21 = new DataGridViewTextBoxColumn();
			this._D22 = new DataGridViewTextBoxColumn();
			this._D23 = new DataGridViewTextBoxColumn();
			this._D24 = new DataGridViewTextBoxColumn();
			this._D25 = new DataGridViewTextBoxColumn();
			this._D26 = new DataGridViewTextBoxColumn();
			this._D27 = new DataGridViewTextBoxColumn();
			this._D28 = new DataGridViewTextBoxColumn();
			this._D29 = new DataGridViewTextBoxColumn();
			this._D30 = new DataGridViewTextBoxColumn();
			this._D31 = new DataGridViewTextBoxColumn();
			((ISupportInitialize)this.dgvProduct).BeginInit();
			base.SuspendLayout();
			this.btnClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnClose.Cursor = Cursors.Hand;
			this.btnClose.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnClose.FlatStyle = FlatStyle.Flat;
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(797, 564);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(96, 26);
			this.btnClose.TabIndex = 6;
			this.btnClose.Text = "Thoát  [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.btnPrint.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnPrint.Cursor = Cursors.Hand;
			this.btnPrint.Enabled = false;
			this.btnPrint.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnPrint.FlatStyle = FlatStyle.Flat;
			this.btnPrint.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnPrint.Location = new System.Drawing.Point(424, 566);
			this.btnPrint.Name = "btnPrint";
			this.btnPrint.Size = new Size(102, 26);
			this.btnPrint.TabIndex = 4;
			this.btnPrint.Text = "Xem và in [ F7 ]";
			this.btnPrint.UseVisualStyleBackColor = true;
			this.btnPrint.Click += new EventHandler(this.btnPrint_Click);
			this.lblWarning.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.lblWarning.BackColor = Color.White;
			this.lblWarning.BorderStyle = BorderStyle.Fixed3D;
			this.lblWarning.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.lblWarning.ForeColor = Color.Red;
			this.lblWarning.Location = new System.Drawing.Point(246, 7);
			this.lblWarning.Name = "lblWarning";
			this.lblWarning.Size = new Size(357, 20);
			this.lblWarning.TabIndex = 42;
			this.lblWarning.Text = "---";
			this.lblWarning.TextAlign = ContentAlignment.MiddleLeft;
			this.lblWarning.Visible = false;
			this.btnExportToExcel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnExportToExcel.Enabled = false;
			this.btnExportToExcel.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnExportToExcel.FlatStyle = FlatStyle.Flat;
			this.btnExportToExcel.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnExportToExcel.Location = new System.Drawing.Point(528, 566);
			this.btnExportToExcel.Name = "btnExportToExcel";
			this.btnExportToExcel.Size = new Size(78, 26);
			this.btnExportToExcel.TabIndex = 5;
			this.btnExportToExcel.Text = "Xuất Excel";
			this.btnExportToExcel.UseVisualStyleBackColor = true;
			this.btnExportToExcel.Click += new EventHandler(this.btnExportToExcel_Click);
			this.label4.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.label4.BackColor = SystemColors.ControlLight;
			this.label4.Font = new Font("Arial", 12f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label4.Location = new System.Drawing.Point(111, 7);
			this.label4.Name = "label4";
			this.label4.Size = new Size(782, 24);
			this.label4.TabIndex = 48;
			this.label4.Text = "SỔ THEO VỆ SINH NHÀ THUỐC";
			this.label4.TextAlign = ContentAlignment.MiddleCenter;
			this.btnEdit.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnEdit.Cursor = Cursors.Hand;
			this.btnEdit.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnEdit.FlatStyle = FlatStyle.Flat;
			this.btnEdit.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnEdit.Location = new System.Drawing.Point(112, 566);
			this.btnEdit.Name = "btnEdit";
			this.btnEdit.Size = new Size(102, 26);
			this.btnEdit.TabIndex = 2;
			this.btnEdit.Text = "Cập nhật [ F5 ]";
			this.btnEdit.UseVisualStyleBackColor = true;
			this.btnEdit.Click += new EventHandler(this.btnEdit_Click);
			this.btnUpdate.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnUpdate.Cursor = Cursors.Hand;
			this.btnUpdate.Enabled = false;
			this.btnUpdate.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnUpdate.FlatStyle = FlatStyle.Flat;
			this.btnUpdate.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnUpdate.Location = new System.Drawing.Point(216, 566);
			this.btnUpdate.Name = "btnUpdate";
			this.btnUpdate.Size = new Size(102, 26);
			this.btnUpdate.TabIndex = 3;
			this.btnUpdate.Text = "Ghi nhận [ F6 ]";
			this.btnUpdate.UseVisualStyleBackColor = true;
			this.btnUpdate.Click += new EventHandler(this.btnUpdate_Click);
			this.btnAdd.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnAdd.Cursor = Cursors.Hand;
			this.btnAdd.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnAdd.FlatStyle = FlatStyle.Flat;
			this.btnAdd.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnAdd.Location = new System.Drawing.Point(4, 566);
			this.btnAdd.Name = "btnAdd";
			this.btnAdd.Size = new Size(106, 26);
			this.btnAdd.TabIndex = 1;
			this.btnAdd.Text = "Thêm mới [ F4 ]";
			this.btnAdd.UseVisualStyleBackColor = true;
			this.btnAdd.Click += new EventHandler(this.btnAdd_Click);
			this.label1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.label1.BorderStyle = BorderStyle.FixedSingle;
			this.label1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label1.Location = new System.Drawing.Point(111, 34);
			this.label1.Name = "label1";
			this.label1.Size = new Size(782, 24);
			this.label1.TabIndex = 49;
			this.label1.Text = "Ngày";
			this.label1.TextAlign = ContentAlignment.MiddleCenter;
			this.label2.BorderStyle = BorderStyle.FixedSingle;
			this.label2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label2.Location = new System.Drawing.Point(5, 34);
			this.label2.Name = "label2";
			this.label2.Size = new Size(107, 54);
			this.label2.TabIndex = 50;
			this.label2.Text = "Đối tượng";
			this.label2.TextAlign = ContentAlignment.MiddleCenter;
			this.label3.BorderStyle = BorderStyle.FixedSingle;
			this.label3.Font = new Font("Arial", 9f);
			this.label3.Location = new System.Drawing.Point(5, 87);
			this.label3.Name = "label3";
			this.label3.Size = new Size(107, 39);
			this.label3.TabIndex = 51;
			this.label3.Text = "Lau nền : ";
			this.label3.TextAlign = ContentAlignment.MiddleRight;
			this.label5.BorderStyle = BorderStyle.FixedSingle;
			this.label5.Font = new Font("Arial", 9f);
			this.label5.Location = new System.Drawing.Point(5, 125);
			this.label5.Name = "label5";
			this.label5.Size = new Size(107, 39);
			this.label5.TabIndex = 52;
			this.label5.Text = "Lau tủ : ";
			this.label5.TextAlign = ContentAlignment.MiddleRight;
			this.label6.BorderStyle = BorderStyle.FixedSingle;
			this.label6.Font = new Font("Arial", 9f);
			this.label6.Location = new System.Drawing.Point(5, 201);
			this.label6.Name = "label6";
			this.label6.Size = new Size(107, 39);
			this.label6.TabIndex = 54;
			this.label6.Text = "Lau tường : ";
			this.label6.TextAlign = ContentAlignment.MiddleRight;
			this.label7.BorderStyle = BorderStyle.FixedSingle;
			this.label7.Font = new Font("Arial", 9f);
			this.label7.Location = new System.Drawing.Point(5, 163);
			this.label7.Name = "label7";
			this.label7.Size = new Size(107, 39);
			this.label7.TabIndex = 53;
			this.label7.Text = "Lau bàn ghế : ";
			this.label7.TextAlign = ContentAlignment.MiddleRight;
			this.label8.BorderStyle = BorderStyle.FixedSingle;
			this.label8.Font = new Font("Arial", 9f);
			this.label8.Location = new System.Drawing.Point(5, 277);
			this.label8.Name = "label8";
			this.label8.Size = new Size(107, 39);
			this.label8.TabIndex = 56;
			this.label8.Text = "Sắp xếp thuốc : ";
			this.label8.TextAlign = ContentAlignment.MiddleRight;
			this.label9.BorderStyle = BorderStyle.FixedSingle;
			this.label9.Font = new Font("Arial", 9f);
			this.label9.Location = new System.Drawing.Point(5, 239);
			this.label9.Name = "label9";
			this.label9.Size = new Size(107, 39);
			this.label9.TabIndex = 55;
			this.label9.Text = "Quét trần : ";
			this.label9.TextAlign = ContentAlignment.MiddleRight;
			this.label10.BorderStyle = BorderStyle.FixedSingle;
			this.label10.Font = new Font("Arial", 9f);
			this.label10.Location = new System.Drawing.Point(5, 353);
			this.label10.Name = "label10";
			this.label10.Size = new Size(107, 39);
			this.label10.TabIndex = 58;
			this.label10.Text = "Người kiểm tra : ";
			this.label10.TextAlign = ContentAlignment.MiddleRight;
			this.label11.BorderStyle = BorderStyle.FixedSingle;
			this.label11.Font = new Font("Arial", 9f);
			this.label11.Location = new System.Drawing.Point(5, 315);
			this.label11.Name = "label11";
			this.label11.Size = new Size(107, 39);
			this.label11.TabIndex = 57;
			this.label11.Text = "Người thực hiện : ";
			this.label11.TextAlign = ContentAlignment.MiddleRight;
			this.dtpTime.CalendarFont = new Font("Arial", 10.25f, FontStyle.Bold);
			this.dtpTime.CustomFormat = "   MM/yyyy";
			this.dtpTime.DropDownAlign = LeftRightAlignment.Right;
			this.dtpTime.Font = new Font("Arial", 11f, FontStyle.Bold);
			this.dtpTime.Format = DateTimePickerFormat.Custom;
			this.dtpTime.Location = new System.Drawing.Point(5, 7);
			this.dtpTime.Name = "dtpTime";
			this.dtpTime.Size = new Size(106, 24);
			this.dtpTime.TabIndex = 59;
			this.dtpTime.ValueChanged += new EventHandler(this.dtpTime_ValueChanged);
			this.label12.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.label12.Font = new Font("Arial", 9f, FontStyle.Bold);
			this.label12.Location = new System.Drawing.Point(111, 430);
			this.label12.Name = "label12";
			this.label12.Size = new Size(782, 27);
			this.label12.TabIndex = 60;
			this.label12.Text = "  Ghi chú : Đánh dấu \"x\" vào ô có thực hiện";
			this.label12.TextAlign = ContentAlignment.MiddleLeft;
			this.btnReset.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnReset.Cursor = Cursors.Hand;
			this.btnReset.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnReset.FlatStyle = FlatStyle.Flat;
			this.btnReset.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnReset.Location = new System.Drawing.Point(320, 566);
			this.btnReset.Name = "btnReset";
			this.btnReset.Size = new Size(102, 26);
			this.btnReset.TabIndex = 61;
			this.btnReset.Text = "Khởi tạo [ F8 ]";
			this.btnReset.UseVisualStyleBackColor = true;
			this.btnReset.Click += new EventHandler(this.btnReset_Click);
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.AllowUserToDeleteRows = false;
			this.dgvProduct.AllowUserToOrderColumns = true;
			this.dgvProduct.AllowUserToResizeColumns = false;
			this.dgvProduct.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvProduct.BackgroundColor = Color.White;
			this.dgvProduct.BorderStyle = BorderStyle.Fixed3D;
			dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleCenter;
			dataGridViewCellStyle2.BackColor = SystemColors.Control;
			dataGridViewCellStyle2.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle2.ForeColor = SystemColors.WindowText;
			dataGridViewCellStyle2.SelectionBackColor = SystemColors.Highlight;
			dataGridViewCellStyle2.SelectionForeColor = SystemColors.HighlightText;
			this.dgvProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
			this.dgvProduct.ColumnHeadersHeight = 30;
			this.dgvProduct.Columns.AddRange(new DataGridViewColumn[]
			{
				this._Year,
				this._Month,
				this._Object,
				this._D1,
				this._D2,
				this._D3,
				this._D4,
				this._D5,
				this._D6,
				this._D7,
				this._D8,
				this._D9,
				this._D10,
				this._D11,
				this._D12,
				this._D13,
				this._D14,
				this._D15,
				this._D16,
				this._D17,
				this._D18,
				this._D19,
				this._D20,
				this._D21,
				this._D22,
				this._D23,
				this._D24,
				this._D25,
				this._D26,
				this._D27,
				this._D28,
				this._D29,
				this._D30,
				this._D31
			});
			this.dgvProduct.Cursor = Cursors.Hand;
			this.dgvProduct.EnableHeadersVisualStyles = false;
			this.dgvProduct.Location = new System.Drawing.Point(111, 57);
			this.dgvProduct.MultiSelect = false;
			this.dgvProduct.Name = "dgvProduct";
			this.dgvProduct.ReadOnly = true;
			dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle3.BackColor = SystemColors.Control;
			dataGridViewCellStyle3.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle3.ForeColor = SystemColors.WindowText;
			dataGridViewCellStyle3.SelectionBackColor = SystemColors.Highlight;
			dataGridViewCellStyle3.SelectionForeColor = SystemColors.HighlightText;
			this.dgvProduct.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
			this.dgvProduct.RowHeadersVisible = false;
			this.dgvProduct.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle4.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.RowsDefaultCellStyle = dataGridViewCellStyle4;
			this.dgvProduct.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.RowTemplate.Height = 38;
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvProduct.Size = new Size(782, 352);
			this.dgvProduct.TabIndex = 0;
			this.dgvProduct.RowsAdded += new DataGridViewRowsAddedEventHandler(this.dgvProduct_RowsAdded);
			this.dgvProduct.CellEnter += new DataGridViewCellEventHandler(this.dgvProduct_CellEnter);
			this._Year.DataPropertyName = "_Year";
			this._Year.HeaderText = "Năm";
			this._Year.Name = "_Year";
			this._Year.ReadOnly = true;
			this._Year.Visible = false;
			this._Month.DataPropertyName = "_Month";
			this._Month.HeaderText = "Tháng";
			this._Month.Name = "_Month";
			this._Month.ReadOnly = true;
			this._Month.Visible = false;
			this._Object.DataPropertyName = "_Object";
			this._Object.HeaderText = "Đối tượng";
			this._Object.Name = "_Object";
			this._Object.ReadOnly = true;
			this._Object.Visible = false;
			this._D1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D1.DataPropertyName = "_D1";
			dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D1.DefaultCellStyle = dataGridViewCellStyle5;
			this._D1.HeaderText = "1";
			this._D1.MinimumWidth = 32;
			this._D1.Name = "_D1";
			this._D1.ReadOnly = true;
			this._D1.Width = 32;
			this._D2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D2.DataPropertyName = "_D2";
			dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D2.DefaultCellStyle = dataGridViewCellStyle6;
			this._D2.HeaderText = "2";
			this._D2.MinimumWidth = 32;
			this._D2.Name = "_D2";
			this._D2.ReadOnly = true;
			this._D2.Width = 32;
			this._D3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D3.DataPropertyName = "_D3";
			dataGridViewCellStyle7.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D3.DefaultCellStyle = dataGridViewCellStyle7;
			this._D3.HeaderText = "3";
			this._D3.MinimumWidth = 32;
			this._D3.Name = "_D3";
			this._D3.ReadOnly = true;
			this._D3.Width = 32;
			this._D4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D4.DataPropertyName = "_D4";
			dataGridViewCellStyle8.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D4.DefaultCellStyle = dataGridViewCellStyle8;
			this._D4.HeaderText = "4";
			this._D4.MinimumWidth = 32;
			this._D4.Name = "_D4";
			this._D4.ReadOnly = true;
			this._D4.Width = 32;
			this._D5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D5.DataPropertyName = "_D5";
			dataGridViewCellStyle9.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D5.DefaultCellStyle = dataGridViewCellStyle9;
			this._D5.HeaderText = "5";
			this._D5.MinimumWidth = 32;
			this._D5.Name = "_D5";
			this._D5.ReadOnly = true;
			this._D5.Width = 32;
			this._D6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D6.DataPropertyName = "_D6";
			dataGridViewCellStyle10.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D6.DefaultCellStyle = dataGridViewCellStyle10;
			this._D6.HeaderText = "6";
			this._D6.MinimumWidth = 32;
			this._D6.Name = "_D6";
			this._D6.ReadOnly = true;
			this._D6.Width = 32;
			this._D7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D7.DataPropertyName = "_D7";
			dataGridViewCellStyle11.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D7.DefaultCellStyle = dataGridViewCellStyle11;
			this._D7.HeaderText = "7";
			this._D7.MinimumWidth = 32;
			this._D7.Name = "_D7";
			this._D7.ReadOnly = true;
			this._D7.Width = 32;
			this._D8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D8.DataPropertyName = "_D8";
			dataGridViewCellStyle12.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D8.DefaultCellStyle = dataGridViewCellStyle12;
			this._D8.HeaderText = "8";
			this._D8.MinimumWidth = 32;
			this._D8.Name = "_D8";
			this._D8.ReadOnly = true;
			this._D8.Width = 32;
			this._D9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D9.DataPropertyName = "_D9";
			dataGridViewCellStyle13.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D9.DefaultCellStyle = dataGridViewCellStyle13;
			this._D9.HeaderText = "9";
			this._D9.MinimumWidth = 32;
			this._D9.Name = "_D9";
			this._D9.ReadOnly = true;
			this._D9.Width = 32;
			this._D10.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D10.DataPropertyName = "_D10";
			dataGridViewCellStyle14.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D10.DefaultCellStyle = dataGridViewCellStyle14;
			this._D10.HeaderText = "10";
			this._D10.MinimumWidth = 32;
			this._D10.Name = "_D10";
			this._D10.ReadOnly = true;
			this._D10.Width = 32;
			this._D11.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D11.DataPropertyName = "_D11";
			dataGridViewCellStyle15.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D11.DefaultCellStyle = dataGridViewCellStyle15;
			this._D11.HeaderText = "11";
			this._D11.MinimumWidth = 32;
			this._D11.Name = "_D11";
			this._D11.ReadOnly = true;
			this._D11.Width = 32;
			this._D12.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D12.DataPropertyName = "_D12";
			dataGridViewCellStyle16.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D12.DefaultCellStyle = dataGridViewCellStyle16;
			this._D12.HeaderText = "12";
			this._D12.MinimumWidth = 32;
			this._D12.Name = "_D12";
			this._D12.ReadOnly = true;
			this._D12.Width = 32;
			this._D13.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D13.DataPropertyName = "_D13";
			dataGridViewCellStyle17.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D13.DefaultCellStyle = dataGridViewCellStyle17;
			this._D13.HeaderText = "13";
			this._D13.MinimumWidth = 32;
			this._D13.Name = "_D13";
			this._D13.ReadOnly = true;
			this._D13.Width = 32;
			this._D14.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D14.DataPropertyName = "_D14";
			dataGridViewCellStyle18.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D14.DefaultCellStyle = dataGridViewCellStyle18;
			this._D14.HeaderText = "14";
			this._D14.MinimumWidth = 32;
			this._D14.Name = "_D14";
			this._D14.ReadOnly = true;
			this._D14.Width = 32;
			this._D15.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D15.DataPropertyName = "_D15";
			dataGridViewCellStyle19.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D15.DefaultCellStyle = dataGridViewCellStyle19;
			this._D15.HeaderText = "15";
			this._D15.MinimumWidth = 32;
			this._D15.Name = "_D15";
			this._D15.ReadOnly = true;
			this._D15.Width = 32;
			this._D16.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D16.DataPropertyName = "_D16";
			dataGridViewCellStyle20.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D16.DefaultCellStyle = dataGridViewCellStyle20;
			this._D16.HeaderText = "16";
			this._D16.MinimumWidth = 32;
			this._D16.Name = "_D16";
			this._D16.ReadOnly = true;
			this._D16.Width = 32;
			this._D17.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D17.DataPropertyName = "_D17";
			dataGridViewCellStyle21.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D17.DefaultCellStyle = dataGridViewCellStyle21;
			this._D17.HeaderText = "17";
			this._D17.MinimumWidth = 32;
			this._D17.Name = "_D17";
			this._D17.ReadOnly = true;
			this._D17.Width = 32;
			this._D18.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D18.DataPropertyName = "_D18";
			dataGridViewCellStyle22.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D18.DefaultCellStyle = dataGridViewCellStyle22;
			this._D18.HeaderText = "18";
			this._D18.MinimumWidth = 32;
			this._D18.Name = "_D18";
			this._D18.ReadOnly = true;
			this._D18.Width = 32;
			this._D19.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D19.DataPropertyName = "_D19";
			dataGridViewCellStyle23.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D19.DefaultCellStyle = dataGridViewCellStyle23;
			this._D19.HeaderText = "19";
			this._D19.MinimumWidth = 32;
			this._D19.Name = "_D19";
			this._D19.ReadOnly = true;
			this._D19.Width = 32;
			this._D20.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D20.DataPropertyName = "_D20";
			dataGridViewCellStyle24.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D20.DefaultCellStyle = dataGridViewCellStyle24;
			this._D20.HeaderText = "20";
			this._D20.MinimumWidth = 32;
			this._D20.Name = "_D20";
			this._D20.ReadOnly = true;
			this._D20.Width = 32;
			this._D21.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D21.DataPropertyName = "_D21";
			dataGridViewCellStyle25.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D21.DefaultCellStyle = dataGridViewCellStyle25;
			this._D21.HeaderText = "21";
			this._D21.MinimumWidth = 32;
			this._D21.Name = "_D21";
			this._D21.ReadOnly = true;
			this._D21.Width = 32;
			this._D22.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D22.DataPropertyName = "_D22";
			dataGridViewCellStyle26.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D22.DefaultCellStyle = dataGridViewCellStyle26;
			this._D22.HeaderText = "22";
			this._D22.MinimumWidth = 32;
			this._D22.Name = "_D22";
			this._D22.ReadOnly = true;
			this._D22.Width = 32;
			this._D23.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D23.DataPropertyName = "_D23";
			dataGridViewCellStyle27.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D23.DefaultCellStyle = dataGridViewCellStyle27;
			this._D23.HeaderText = "23";
			this._D23.MinimumWidth = 32;
			this._D23.Name = "_D23";
			this._D23.ReadOnly = true;
			this._D23.Width = 32;
			this._D24.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D24.DataPropertyName = "_D24";
			dataGridViewCellStyle28.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D24.DefaultCellStyle = dataGridViewCellStyle28;
			this._D24.HeaderText = "24";
			this._D24.MinimumWidth = 32;
			this._D24.Name = "_D24";
			this._D24.ReadOnly = true;
			this._D24.Width = 32;
			this._D25.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D25.DataPropertyName = "_D25";
			dataGridViewCellStyle29.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D25.DefaultCellStyle = dataGridViewCellStyle29;
			this._D25.HeaderText = "25";
			this._D25.MinimumWidth = 32;
			this._D25.Name = "_D25";
			this._D25.ReadOnly = true;
			this._D25.Width = 32;
			this._D26.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D26.DataPropertyName = "_D26";
			dataGridViewCellStyle30.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D26.DefaultCellStyle = dataGridViewCellStyle30;
			this._D26.HeaderText = "26";
			this._D26.MinimumWidth = 32;
			this._D26.Name = "_D26";
			this._D26.ReadOnly = true;
			this._D26.Width = 32;
			this._D27.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D27.DataPropertyName = "_D27";
			dataGridViewCellStyle31.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D27.DefaultCellStyle = dataGridViewCellStyle31;
			this._D27.HeaderText = "27";
			this._D27.MinimumWidth = 32;
			this._D27.Name = "_D27";
			this._D27.ReadOnly = true;
			this._D27.Width = 32;
			this._D28.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D28.DataPropertyName = "_D28";
			dataGridViewCellStyle32.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D28.DefaultCellStyle = dataGridViewCellStyle32;
			this._D28.HeaderText = "28";
			this._D28.MinimumWidth = 32;
			this._D28.Name = "_D28";
			this._D28.ReadOnly = true;
			this._D28.Width = 32;
			this._D29.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D29.DataPropertyName = "_D29";
			dataGridViewCellStyle33.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D29.DefaultCellStyle = dataGridViewCellStyle33;
			this._D29.HeaderText = "29";
			this._D29.MinimumWidth = 32;
			this._D29.Name = "_D29";
			this._D29.ReadOnly = true;
			this._D29.Width = 32;
			this._D30.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D30.DataPropertyName = "_D30";
			dataGridViewCellStyle34.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D30.DefaultCellStyle = dataGridViewCellStyle34;
			this._D30.HeaderText = "30";
			this._D30.MinimumWidth = 32;
			this._D30.Name = "_D30";
			this._D30.ReadOnly = true;
			this._D30.Width = 32;
			this._D31.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this._D31.DataPropertyName = "_D31";
			dataGridViewCellStyle35.Alignment = DataGridViewContentAlignment.MiddleCenter;
			this._D31.DefaultCellStyle = dataGridViewCellStyle35;
			this._D31.HeaderText = "31";
			this._D31.MinimumWidth = 32;
			this._D31.Name = "_D31";
			this._D31.ReadOnly = true;
			this._D31.Width = 32;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			this.BackColor = Color.White;
			base.ClientSize = new Size(900, 600);
			base.Controls.Add(this.btnReset);
			base.Controls.Add(this.label12);
			base.Controls.Add(this.dtpTime);
			base.Controls.Add(this.label10);
			base.Controls.Add(this.label11);
			base.Controls.Add(this.label8);
			base.Controls.Add(this.label9);
			base.Controls.Add(this.label6);
			base.Controls.Add(this.label7);
			base.Controls.Add(this.label5);
			base.Controls.Add(this.label3);
			base.Controls.Add(this.btnAdd);
			base.Controls.Add(this.btnUpdate);
			base.Controls.Add(this.btnEdit);
			base.Controls.Add(this.btnExportToExcel);
			base.Controls.Add(this.label4);
			base.Controls.Add(this.btnPrint);
			base.Controls.Add(this.lblWarning);
			base.Controls.Add(this.btnClose);
			base.Controls.Add(this.dgvProduct);
			base.Controls.Add(this.label1);
			base.Controls.Add(this.label2);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmBookCleaningPharmacies";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "SỔ THEO VỆ SINH NHÀ THUỐC";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.frmInput_Load);
			base.KeyDown += new KeyEventHandler(this.frmInput_KeyDown);
			((ISupportInitialize)this.dgvProduct).EndInit();
			base.ResumeLayout(false);
		}
		public frmBookCleaningPharmacies()
		{
			this.InitializeComponent();
		}
		private void showWatting()
		{
			this.objW = new frmWaitting();
			this.objW.ShowDialog();
			Thread.Sleep(40);
		}
		private void frmInput_Load(object sender, EventArgs e)
		{
			ThreadStart start = new ThreadStart(this.showWatting);
			Thread thread = new Thread(start);
			thread.Start();
			if (!thread.Join(150))
			{
				this.dgvProduct.AutoGenerateColumns = false;
				this.getBook();
			}
			thread.Abort();
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void frmInput_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.F4)
			{
				this.btnAdd.PerformClick();
			}
			else
			{
				if (e.KeyCode == Keys.F5)
				{
					this.btnEdit.PerformClick();
				}
				else
				{
					if (e.KeyCode == Keys.F6)
					{
						this.btnUpdate.PerformClick();
					}
					else
					{
						if (e.KeyCode == Keys.F7)
						{
							this.btnPrint.PerformClick();
						}
						else
						{
							if (e.KeyCode == Keys.F8)
							{
								this.btnReset.PerformClick();
							}
							else
							{
								if (e.KeyCode == Keys.Escape)
								{
									base.Close();
								}
							}
						}
					}
				}
			}
		}
		public void getBook()
		{
			try
			{
				this.dgvProduct.DataSource = null;
				SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.CommandText = "SELECT * FROM TabCleaningPharmacies WHERE [_Year] = " + this.dtpTime.Value.Year.ToString() + " AND [_Month] = " + this.dtpTime.Value.Month.ToString();
				SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
				sqlDataAdapter.SelectCommand = sqlCommand;
				DataSet dataSet = new DataSet();
				sqlDataAdapter.Fill(dataSet);
				sqlConnection.Close();
				sqlConnection.Dispose();
				this.dgvProduct.AutoGenerateColumns = false;
				this.dgvProduct.DataSource = dataSet.Tables[0];
				this.objTable = dataSet.Tables[0];
				if (this.dgvProduct.Rows.Count > 0)
				{
					this.btnPrint.Enabled = true;
					this.btnExportToExcel.Enabled = true;
				}
				else
				{
					this.btnPrint.Enabled = false;
					this.btnExportToExcel.Enabled = false;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
				this.btnPrint.Enabled = false;
				this.btnExportToExcel.Enabled = false;
				this.dgvProduct.DataSource = null;
			}
		}
		private bool checkProductNameInDataGridView(string pName, string Packet, DataTable objTable)
		{
			bool result = false;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper() && objTable.Rows[i]["Packet"].ToString().ToUpper() == Packet.ToUpper())
				{
					result = true;
				}
			}
			return result;
		}
		private bool checkProductNameInDataGridView(string pName, DataTable objTable)
		{
			bool result = false;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper())
				{
					result = true;
				}
			}
			return result;
		}
		private void btnSearch_Click(object sender, EventArgs e)
		{
			this.getBook();
		}
		private void resetDataGridView()
		{
			this.btnPrint.Enabled = false;
		}
		private void btnPrint_Click(object sender, EventArgs e)
		{
			frmBookSellNotBillView frmBookSellNotBillView = new frmBookSellNotBillView();
			frmBookSellNotBillView.objectName = "BookCleaningPharmacies";
			frmBookCleaningPharmaciesPrint.objTable = this.objTable;
			frmBookCleaningPharmaciesPrint.printDate = "Tháng " + this.dtpTime.Value.Month.ToString() + " năm " + this.dtpTime.Value.Year.ToString();
			frmBookSellNotBillView.ShowDialog();
		}
		private void btnExportToExcel_Click(object sender, EventArgs e)
		{
			try
			{
				frmBookCleaningPharmaciesPrint.objTable = new DataTable();
				frmBookCleaningPharmaciesPrint.objTable = this.objTable;
				ActiveReport3 activeReport = new frmBookCleaningPharmaciesPrint();
				activeReport.Run();
				XlsExport xlsExport = new XlsExport();
				SaveFileDialog saveFileDialog = new SaveFileDialog();
				saveFileDialog.ShowDialog();
				string text = saveFileDialog.FileName;
				if (text != "")
				{
					if (!text.ToUpper().Contains(".XLS"))
					{
						text += ".xls";
					}
					xlsExport.Export(activeReport.Document, text);
					MessageBox.Show("Hệ thống đã hoàn thành việc xuất dữ liệu ra file Excel", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				else
				{
					MessageBox.Show("Bạn chưa chọn đường dẫn và tên file cần xuất!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}
			}
			catch
			{
			}
		}
		private void btnEdit_Click(object sender, EventArgs e)
		{
			this.dgvProduct.ReadOnly = false;
			this.btnUpdate.Enabled = true;
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.CellSelect;
		}
		private void btnUpdate_Click(object sender, EventArgs e)
		{
			this.delInfo();
			this.saveInfo();
			this.dgvProduct.ReadOnly = true;
			this.btnUpdate.Enabled = false;
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
		}
		private void delInfo()
		{
			try
			{
				SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.CommandText = "DELETE TabCleaningPharmacies WHERE [_Year] = " + this.dtpTime.Value.Year.ToString() + " AND [_Month] = " + this.dtpTime.Value.Month.ToString();
				sqlCommand.ExecuteNonQuery();
				sqlConnection.Close();
				sqlConnection.Dispose();
			}
			catch
			{
			}
		}
		private void saveInfo()
		{
			try
			{
				string[] array = new string[]
				{
					"Lau nền",
					"Lau tủ",
					"Lau bàn ghế",
					"Lau tường",
					"Quét trần",
					"Sắp xếp thuốc",
					"Người thực hiện",
					"Người kiểm tra"
				};
				SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				for (int i = 0; i < array.Length; i++)
				{
					sqlCommand.CommandText = string.Concat(new object[]
					{
						"INSERT INTO TabCleaningPharmacies(_Year,_Month,_Object,_D1,_D2,_D3,_D4,_D5,_D6,_D7,_D8,_D9,_D10,_D11,_D12,_D13,_D14,_D15,_D16,_D17,_D18,_D19,_D20,_D21,_D22,_D23,_D24,_D25,_D26,_D27,_D28,_D29,_D30,_D31) VALUES(",
						this.dtpTime.Value.Year,
						",",
						this.dtpTime.Value.Month,
						",N'",
						array[i],
						"','",
						this.dgvProduct.Rows[i].Cells["_D1"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D2"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D3"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D4"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D5"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D6"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D7"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D8"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D9"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D10"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D11"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D12"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D13"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D14"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D15"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D16"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D17"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D18"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D19"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D20"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D21"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D22"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D23"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D24"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D25"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D26"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D27"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D28"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D29"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D30"].Value.ToString(),
						"','",
						this.dgvProduct.Rows[i].Cells["_D31"].Value.ToString(),
						"')"
					});
					sqlCommand.ExecuteNonQuery();
				}
				sqlConnection.Close();
				sqlConnection.Dispose();
				MessageBox.Show("Thông tin đã được lưu vào cở sở dữ liệu !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			catch
			{
			}
		}
		private void dgvProduct_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
		}
		private void btnAdd_Click(object sender, EventArgs e)
		{
			try
			{
				this.dgvProduct.AllowUserToAddRows = true;
				this.dgvProduct.ReadOnly = false;
				this.btnUpdate.Enabled = true;
				this.dgvProduct.SelectionMode = DataGridViewSelectionMode.CellSelect;
			}
			catch
			{
			}
		}
		private void dgvProduct_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
		{
		}
		private void dtpTime_ValueChanged(object sender, EventArgs e)
		{
			this.getBook();
		}
		private void btnReset_Click(object sender, EventArgs e)
		{
			if (MessageBox.Show("Bạn có chắc chắn muốn xoá dữ liệu của tháng hiện tại không ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
			{
				this.delInfo();
				this.getBook();
			}
		}
	}
}
